ABC314 C - Rotate Colored Subsequence
提出
code: python
from collections import defaultdict
n, m = map(int, input().split())
s = input()
c = list(map(int, input().split()))
d = defaultdict(int)
for i in range(n):
print(d)
# どうやって回す?
解答
code: python
n, m = map(int, input().split())
s = input()
c = list(map(int, input().split()))
color = [[] for _ in range(m)]
for i in range(n):
# print(color)
# 各色が何回でたか
res = ""
for i in range(n):
res += s[color[ci][(p[ci] - 1 + mod) % mod]] print(res)
code: python
n, m = map(int, input().split())
s = input()
c = list(map(int, input().split()))
color = [[] for _ in range(m)]
for i in range(n):
# print(color)
# 右回り
# 2 0 1
# 3 0 1 2
# 0
# 各色が何回でたか
res = ""
for i in range(n):
res += s[color[ci][len(color[ci])-1]] else:
res += s[color[ci][p[ci]-1]] print(res)
メモ